This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.

Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Ctrl+Shift+Enter.

source("tianfengRwrappers.R")
载入需要的程辑包:reticulate
载入需要的程辑包:tidyr

载入程辑包:‘MySeuratWrappers’

The following objects are masked from ‘package:Seurat’:

    DimPlot, DoHeatmap, LabelClusters, RidgePlot, VlnPlot


载入程辑包:‘ggpubr’

The following object is masked from ‘package:rbokeh’:

    set_palette


载入程辑包:‘cowplot’

The following object is masked from ‘package:ggpubr’:

    get_legend

载入需要的程辑包:viridisLite

载入程辑包:‘reshape2’

The following object is masked from ‘package:tidyr’:

    smiths

NOTE: Either Arial Narrow or Roboto Condensed fonts are required to use these themes.
      Please use hrbrthemes::import_roboto_condensed() to install Roboto Condensed and
      if Arial Narrow is not on your system, please see https://bit.ly/arialnarrow
clusterProfiler v3.14.3  For help: https://guangchuangyu.github.io/software/clusterProfiler

If you use clusterProfiler in published research, please cite:
Guangchuang Yu, Li-Gen Wang, Yanyan Han, Qing-Yu He. clusterProfiler: an R package for comparing biological themes among gene clusters. OMICS: A Journal of Integrative Biology. 2012, 16(5):284-287.
Registering fonts with R

载入程辑包:‘plotly’

The following object is masked from ‘package:ggplot2’:

    last_plot

The following object is masked from ‘package:stats’:

    filter

The following object is masked from ‘package:graphics’:

    layout

载入需要的程辑包:e1071
Registered S3 methods overwritten by 'proxy':
  method               from    
  print.registry_field registry
  print.registry_entry registry

载入程辑包:‘widgetTools’

The following object is masked from ‘package:dplyr’:

    funs


载入程辑包:‘DynDoc’

The following object is masked from ‘package:BiocGenerics’:

    path


载入程辑包:‘IDPmisc’

The following object is masked from ‘package:shiny’:

    hr


载入程辑包:‘DT’

The following objects are masked from ‘package:shiny’:

    dataTableOutput, renderDataTable

The following object is masked from ‘package:Seurat’:

    JS

========================================
circlize version 0.4.13
CRAN page: https://cran.r-project.org/package=circlize
Github page: https://github.com/jokergoo/circlize
Documentation: https://jokergoo.github.io/circlize_book/book/

If you use it in published research, please cite:
Gu, Z. circlize implements and enhances circular visualization
  in R. Bioinformatics 2014.

This message can be suppressed by:
  suppressPackageStartupMessages(library(circlize))
========================================

载入需要的程辑包:grid
========================================
ComplexHeatmap version 2.2.0
Bioconductor page: http://bioconductor.org/packages/ComplexHeatmap/
Github page: https://github.com/jokergoo/ComplexHeatmap
Documentation: http://jokergoo.github.io/ComplexHeatmap-reference

If you use it in published research, please cite:
Gu, Z. Complex heatmaps reveal patterns and correlations in multidimensional 
  genomic data. Bioinformatics 2016.
========================================


载入程辑包:‘ComplexHeatmap’

The following object is masked from ‘package:plotly’:

    add_heatmap

功能分析

BMP相关基因

BMP通路相关

gsave("BMPreceptor_ds1.png", device = png, plot = Dotplot(c("BMPR1A","BMPR1B"),ds1), height = 6, width = 5)
Error in gsave("BMPreceptor_ds1.png", device = png, plot = Dotplot(c("BMPR1A",  : 
  没有"gsave"这个函数

雷达图 fig4

library(fmsb)
data <- read.csv("./go_res.csv",row.names = 1,quote = "", check.names=FALSE)
# data=as.data.frame(matrix(sample(0:50, 18,replace=T) , ncol=6))
# colnames(data)=c('IL-1 signaling pathway','Response to IFNa','NFkB signaling pathway','IL-6 signaling pathway', 'Muscle contraction','Response to IFNr')
# rownames(data) <- c('Monocyte','Neutrophil','Macrophage')
# 用于生成雷达图的最大最小值
data=rbind(rep(15,5) , rep(-10,5) , data)


colors_border <- colors_list[c(4,1,5)]
colors_in <- aero_colors_list[c(4,1,5)]

svg("GO_res.svg",height = 8,width = 10)
radarchart(data, axistype=0, seg = 5,
 pcol=colors_border, pfcol=colors_in, plwd=1.3 , plty=1,pty=32,
 cglcol="black", cglty=3, cglwd=0.6,
)
legend(x=-1.6, y=0.5, legend = rownames(data[-c(1,2),]), bty = "n", pch=20 , col=colors_border, text.col = "black", cex=1, pt.cex=2)
dev.off()

Add a new chunk by clicking the Insert Chunk button on the toolbar or by pressing Ctrl+Alt+I.

When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the Preview button or press Ctrl+Shift+K to preview the HTML file).

The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike Knit, Preview does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.

LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKVGhpcyBpcyBhbiBbUiBNYXJrZG93bl0oaHR0cDovL3JtYXJrZG93bi5yc3R1ZGlvLmNvbSkgTm90ZWJvb2suIFdoZW4geW91IGV4ZWN1dGUgY29kZSB3aXRoaW4gdGhlIG5vdGVib29rLCB0aGUgcmVzdWx0cyBhcHBlYXIgYmVuZWF0aCB0aGUgY29kZS4gCgpUcnkgZXhlY3V0aW5nIHRoaXMgY2h1bmsgYnkgY2xpY2tpbmcgdGhlICpSdW4qIGJ1dHRvbiB3aXRoaW4gdGhlIGNodW5rIG9yIGJ5IHBsYWNpbmcgeW91ciBjdXJzb3IgaW5zaWRlIGl0IGFuZCBwcmVzc2luZyAqQ3RybCtTaGlmdCtFbnRlciouIApgYGB7cn0Kc291cmNlKCJ0aWFuZmVuZ1J3cmFwcGVycy5SIikKYGBgCgojIyDlip/og73liIbmnpAKQk1Q55u45YWz5Z+65ZugCmBgYHtyfQoKZ2dzYXZlKCJkb3RCTVBtYXJrZXJzX2RzMi5zdmciLCBkZXZpY2UgPSBzdmcsIHBsb3QgPSBEb3RwbG90KGMoIkRMWDYiLCJETFg1IiwiRExYNi1BUzEiLCJTT1NUIiksZHMyKSwgaGVpZ2h0ID0gNiwgd2lkdGggPSA4KQpnZ3NhdmUoImRvdEJNUG1hcmtlcnNfZHMxLnN2ZyIsIGRldmljZSA9IHN2ZywgcGxvdCA9IERvdHBsb3QoYygiRExYNiIsIkRMWDUiLCJETFg2LUFTMSIsIlNPU1QiKSxkczEpLCBoZWlnaHQgPSA2LCB3aWR0aCA9IDgpCgoKZ2dzYXZlKCJCTVBtYXJrZXJzX2RzMi5wbmciLCBkZXZpY2UgPSBwbmcsIHBsb3QgPSBtd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